<template>
  <el-form ref="form" :model="user" label-width="80px">
    <el-form-item label="个人简介" prop="introduction">
      <el-input type="textarea" :rows="5" v-model="user.introduction">
      </el-input>
    </el-form-item>
    <el-form-item>
      <el-button type="primary" size="mini" @click="submit">保存</el-button>
      <el-button type="danger" size="mini" @click="close">关闭</el-button>
    </el-form-item>
  </el-form>
</template>

<script>
import { updateUserIntroduction } from "@/api/system/user";

export default {
  props: {
    user: {
      type: Object
    }
  },
  data () {
    return {
    }
  },
  methods: {
    submit () {
      updateUserIntroduction(this.user.userId, this.user.introduction).then(response => {
        this.msgSuccess("修改成功");
      });
    },
    close () {
      this.$store.dispatch("tagsView/delView", this.$route);
      this.$router.push({ path: "/index" });
    }
  }
}
</script>

<style>
</style>